<%@ page pageEncoding="UTF-8"%>
<%@ include file="/common/validate.jsp"%>
<%@ include file="function.jsp"%>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>标签管理</title>
    <link rel="stylesheet" href="/css/public.css?cache=<%=Math.random()%>">
    <link  href="../../hos_manage/images/favicon.ico?cache=<%=Math.random()%>" rel="shortcut icon" type="image/x-icon">
    <link rel="stylesheet" type="text/css" href="../../css/palace/tag/sub_list.css?a=<%=Math.random()%>">
    <script src="/js/jquery-1.9.1.min.js"></script>
</head>
<body id="app" v-cloak>
<%@ include file="../../header.jsp"%>
<!--内容-->
<div class="containerone">
    <%@ include file="../../left_menu.jsp"%>
    <!--右边内容-->
    <div class="right_cont">
        <!--右边导航下面内容-->
        <div class="sub-list">
            <div class="title">
                <div class="address-left show-block note">
                    <span class="hover" @click="homePage()">首页</span>
                    <span class="left-distance">></span>
                    <span class="left-distance hover" @click="tagManage()">标签列表</span>
                    <span class="left-distance">></span>
                    <span class="left-distance">基础标签</span>
                    <span class="left-distance">></span>
                    <span class="left-distance" v-html="tag.name"></span>
                </div>
            </div>
            <div class="container">
                <div class="position">
                    <div class="show-block address-book-right">
                        <div class="data-form show-margin-left">
                            <div class="title-width show-block" v-for="i in list" v-html="i.name"></div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<danger v-if="dangerTipShow" :title="dangerTitle"></danger>
</body>
<%@ include file="/components/danger.jsp"%>
<script>
    var HOSPITAL = "${user.hospital}";
    new Vue({
        el: "#app",
        data: {
            list: [],
            dangerTitle: "",
            dangerTipShow: false,
            tag: {},
        },
        events: {
            dangerTipOver: function() {
                this.dangerTipShow = false;
            },
        },
        methods: {
            tagManage: function () {
                locationHerf("tag_manage");
            },
            homePage: function () {
                location.href = "../../index.jsp";
            },
        },
        ready: function() {
            var tag = getHrefParms("sub_list");
            this.tag = tag;
            var _this = this;
            $.ajax({
                type: 'POST',
                url: "sub_list.jsp",
                data: {
                    act: "tagSubList",
                    hospital: HOSPITAL,
                    tag_id: tag.id + "",
                },
                success: function(res) {
                    res = JSON.parse(res);
                    if (res.errcode == 0) {
                        _this.list = res.data;
                    } else {
                        _this.dangerTitle = res.errmsg;
                        _this.dangerTipShow = true;
                    }
                },
            });
        }
    });
</script>
</html>
